package cn.joyfulmedia.mis.service;

import cn.joyfulmedia.dao.ExamMisResourcesMapper;
import cn.joyfulmedia.entity.ExamMisResources;
import cn.joyfulmedia.mis.service.interfaces.ResourcesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service("resourcesService")
public class ResourcesServiceImpl implements ResourcesService {
    @Autowired
    private ExamMisResourcesMapper resourcesDao;

    @Override
    public Integer saveResources(ExamMisResources entity) throws Exception {
        return resourcesDao.saveResources(entity);
    }

    @Override
    public Integer updateResourcesById(ExamMisResources entity) throws Exception {
        return resourcesDao.updateResourcesById(entity);
    }

    @Override
    public ExamMisResources selectResourcesById(Object id) throws Exception {
        return resourcesDao.selectResourcesById(id);
    }

    @Override
    public List<ExamMisResources> findByAccountId(Long id) throws Exception {
        return resourcesDao.findByAccountId(id);
    }

    @Override
    public List<ExamMisResources> list(ExamMisResources resource) {
        return resourcesDao.list(resource);
    }

    public List<ExamMisResources> findByRoleId(Long id) throws Exception {
        return resourcesDao.findByRoleId(id);
    }

}
